package com.omega.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "RMS_ITEM_RECEIVED")
public class ItemReceived extends AbstractEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ITEM_RECEIVED_ID")
	@TableGenerator(table = "PORTAL_TABLE_GENERATOR", name = "TABLE_SEQ_GENERATOR", pkColumnValue = "RETAILER_ID", allocationSize = 1, initialValue = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_SEQ_GENERATOR")
	private long itemReceivedId;

	@Column(name = "BILL_NUM", nullable = true, length = 10)
	private String billNo;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ITEM_ID", nullable = false)
	private Item item;
	
	@Column(name = "NO_OF_UNITS", nullable = true, length = 10)
	private int noOfUnits;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DENOM_ID", nullable = false)
	private ItemDenomination denomination;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEASURING_UNIT_ID", nullable = false)
	private MeasuringUnit measuringUnit;
	
	@Column(name = "PRICE_PER_UNIT", nullable = true, length = 10)
	private int pricePerUnit;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SUPPLIER_ID", nullable = false)
	private Supplier supplier;
	
	@Column(name = "TOTAL_WITHOUT_TAX", nullable = true, length = 10)
	private int totalWithoutTax;
	
	@Column(name = "TAXES", nullable = true, length = 10)
	private int taxes;
	
	@Column(name = "GRAND_TOTAL", nullable = true, length = 10)
	private int grandTotal;
	
	@Column(name = "MONTH", nullable = false, length = 2)
	private int month;

	@Column(name = "YEAR", nullable = false, length = 4)
	private int year;

	/**
	 * @return the itemReceivedId
	 */
	public long getitemReceivedId() {
		return itemReceivedId;
	}

	/**
	 * @param itemReceivedId the itemReceivedId to set
	 */
	public void setitemReceivedId(long itemReceivedId) {
		this.itemReceivedId = itemReceivedId;
	}

	public String getBillNo() {
		return billNo;
	}

	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}

	public int getNoOfUnits() {
		return noOfUnits;
	}

	public void setNoOfUnits(int noOfUnits) {
		this.noOfUnits = noOfUnits;
	}

	public int getPricePerUnit() {
		return pricePerUnit;
	}

	public void setPricePerUnit(int pricePerUnit) {
		this.pricePerUnit = pricePerUnit;
	}

	public int getTotalWithoutTax() {
		return totalWithoutTax;
	}

	public void setTotalWithoutTax(int totalWithoutTax) {
		this.totalWithoutTax = totalWithoutTax;
	}

	public int getTaxes() {
		return taxes;
	}

	public void setTaxes(int taxes) {
		this.taxes = taxes;
	}

	public int getGrandTotal() {
		return grandTotal;
	}

	public void setGrandTotal(int grandTotal) {
		this.grandTotal = grandTotal;
	}

	/**
	 * @return the denomination
	 */
	public ItemDenomination getDenomination() {
		return denomination;
	}

	/**
	 * @param denomination the denomination to set
	 */
	public void setDenomination(ItemDenomination denomination) {
		this.denomination = denomination;
	}

	/**
	 * @return the measuringUnit
	 */
	public MeasuringUnit getMeasuringUnit() {
		return measuringUnit;
	}

	/**
	 * @param measuringUnit the measuringUnit to set
	 */
	public void setMeasuringUnit(MeasuringUnit measuringUnit) {
		this.measuringUnit = measuringUnit;
	}

	/**
	 * @return the supplier
	 */
	public Supplier getSupplier() {
		return supplier;
	}

	/**
	 * @param supplier the supplier to set
	 */
	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	/**
	 * @return the month
	 */
	public int getMonth() {
		return month;
	}

	/**
	 * @return the year
	 */
	public int getYear() {
		return year;
	}

	/**
	 * @param month the month to set
	 */
	public void setMonth(int month) {
		this.month = month;
	}

	/**
	 * @param year the year to set
	 */
	public void setYear(int year) {
		this.year = year;
	}

	/**
	 * @return the itemReceivedId
	 */
	public long getItemReceivedId() {
		return itemReceivedId;
	}

	/**
	 * @return the item
	 */
	public Item getItem() {
		return item;
	}

	/**
	 * @param itemReceivedId the itemReceivedId to set
	 */
	public void setItemReceivedId(long itemReceivedId) {
		this.itemReceivedId = itemReceivedId;
	}

	/**
	 * @param item the item to set
	 */
	public void setItem(Item item) {
		this.item = item;
	}

}
